/**
 * 
 * 
 * Created on 31 mei 2011 @ 19:07:40 by Jesper Keijzer
 */

package tests.jesper;

import combat.dudes.protocol.data.DoublePoint;
import combat.dudes.protocol.types.ProjectileType;
import combat.dudes.protocol.types.VehicleType;
import combat.dudes.server.classes.Calculation;
import combat.dudes.server.protocol.implementation.Simulation;


/**
 * 
 * @author Jesper Keijzer
 * @version 1.0
 */
public class TestJesper {

	/**
	 * 
	 * @author Jesper Keijzer
	 * @param args
	 */
	public static void main(String[] args) {
		Simulation.instance().setSimSpeed(100.0);

		DoublePoint start = new DoublePoint(-110, -110);
		DoublePoint end = new DoublePoint(110, -110);
		double speed = 300;
		double angle = Calculation.MainCalc.direction(start, end);

		// System.out.println(Calculations.MainCalc.Angle(start, end));
		System.out.println(speed + " km/h in cp/s :" + Calculation.MainCalc.kmhToCpsl(speed));
		System.out.println("angle between " + start + " and " + end + ": " + angle + "\ndisctance between " + start + " and " + end + ": " + Calculation.MainCalc.distance(start, end));
		System.out.println("new position: " + Calculation.MainCalc.nextPosition(start, speed, angle));

		// ----------------------------------------

		double a = 60.56278;
		double b = 60.02561;

		double c = 60.56278;
		double d = 60.02561;

		if (((-0.8 < a - b) && (a - b) < 0.8) && ((-0.8 < c - d) && (c - c) < 0.8))
			System.out.println("arrived");

		// ------------------------------------------

		System.out.println(Math.abs(-500));

		// ------------------------------------------

		System.out.println(Calculation.MainCalc.kmhToCpsl(60));

		// ------------------------------------------

		System.out.println(Calculation.DamageCalc.hitTable.getDamage(ProjectileType.MISSILE_GUIDED, VehicleType.CONVOY).getTaskObject1());
		System.out.println(Calculation.DamageCalc.hitTable.getDamage(ProjectileType.MISSILE_GUIDED, VehicleType.CONVOY).getTaskObject2());

		System.out.println(Calculation.DamageCalc.hitTable.getDamage(ProjectileType.MISSILE_GUIDED, ProjectileType.MISSILE_GUIDED).getTaskObject1());
		System.out.println(Calculation.DamageCalc.hitTable.getDamage(ProjectileType.MISSILE_GUIDED, ProjectileType.MISSILE_GUIDED).getTaskObject2());

		// ------------------------------------------
		int p = 10;
		p /= 2;
		System.out.println(p);

	}
}
